<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:11pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:10px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:xx-large; font-weight:600;">VBA Excel. Объект Dictionary (свойства, методы, примеры)</span></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Создание объекта Dictionary с помощью кода VBA Excel. Раннее и позднее связывание. Методы и свойства словаря и синтаксис выражений с ними. Примеры кода.</span></p>
<p style=" margin-top:32px; margin-bottom:6px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#fafafa;"><span style=" font-weight:600; color:#333333;">Содержание</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://vremya-ne-zhdet.ru/vba-excel/object-dictionary/#Sozdanie_obekta_Dictionary"><span style=" text-decoration: underline; color:#0000ff;">1. Создание объекта Dictionary</span></a></p>
<p style=" margin-top:2px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://vremya-ne-zhdet.ru/vba-excel/object-dictionary/#Metody_i_svojstva_slovara"><span style=" text-decoration: underline; color:#0000ff;">2. Методы и свойства словаря</span></a></p>
<p style=" margin-top:2px; margin-bottom:0px; margin-left:14px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://vremya-ne-zhdet.ru/vba-excel/object-dictionary/#Metody_obekta_Dictionary"><span style=" text-decoration: underline; color:#0000ff;">2.1. Методы объекта Dictionary</span></a></p>
<p style=" margin-top:2px; margin-bottom:0px; margin-left:14px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://vremya-ne-zhdet.ru/vba-excel/object-dictionary/#Svojstva_obekta_Dictionary"><span style=" text-decoration: underline; color:#0000ff;">2.2. Свойства объекта Dictionary</span></a></p>
<p style=" margin-top:2px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://vremya-ne-zhdet.ru/vba-excel/object-dictionary/#Primery_koda_s_Dictionary"><span style=" text-decoration: underline; color:#0000ff;">3. Примеры кода с Dictionary</span></a></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f0f0f0;"><span style=" background-color:#f0f0f0;">Dictionary – это объект, предназначенный для записи, хранения и использования пар, состоящих из ключа и элемента данных.</span></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="Sozdanie_obekta_Dictionary"></a><span style=" font-size:x-large; font-weight:600;">С</span><span style=" font-size:x-large; font-weight:600;">оздание объекта Dictionary</span></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Раннее связывание:</span></p>
<p style="-qt-paragraph-type:empty; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:15px; font-family:'Verdana,Arial,sans'; font-size:12px; font-weight:496; background-color:#fdfdfd;"><br /></p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="#dfefff" style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;"></td>
<td style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed500792686797-1"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">D</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">im</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">myDict </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">Dictionary</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed500792686797-2"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">S</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">et</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">myDict</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">New</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">Dictionary</span></p></td></tr></table>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">или</p>
<p style="-qt-paragraph-type:empty; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:15px; font-family:'Verdana,Arial,sans'; font-size:12px; font-weight:496; background-color:#fdfdfd;"><br /></p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="#dfefff" style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;"></td>
<td style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed50a942687009-1"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">D</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">im</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">myDict </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">New</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">Dictionary</span></p></td></tr></table>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Позднее связывание:</span></p>
<p style="-qt-paragraph-type:empty; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:15px; font-family:'Verdana,Arial,sans'; font-size:12px; font-weight:496; background-color:#fdfdfd;"><br /></p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="#dfefff" style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;"></td>
<td style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed50d312486355-1"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">D</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">im</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">myDict </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Object</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed50d312486355-2"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">S</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">et</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">myDict</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">CreateObject</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;Scripting.Dictionary&quot;</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">)</span></p></td></tr></table>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Чтобы использовать <a href="https://vremya-ne-zhdet.ru/vba-excel/ranneye-i-pozdneye-svyazyvaniye/"><span style=" text-decoration: underline; color:#0000ff;">раннее связывание</span></a>, необходимо подключить в редакторе VBA ссылку на библиотеку Microsoft Scripting Runtime, если она еще не подключена (в меню Tools–&gt;References…):</p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Раннее связывание позволяет использовать при написании кода VBA Excel лист выбора и вставки свойств и методов объекта Dictionary (лист подсказок):</p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Лист подсказок отображается автоматически после ввода точки или, в иных случаях, вызывается сочетанием клавиш «Ctrl+Пробел».</p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="Metody_i_svojstva_slovara"></a><span style=" font-size:x-large; font-weight:600;">М</span><span style=" font-size:x-large; font-weight:600;">етоды и свойства словаря</span></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="Metody_obekta_Dictionary"></a><span style=" font-size:large; font-weight:600;">М</span><span style=" font-size:large; font-weight:600;">етоды объекта Dictionary</span></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Метод Add</span><br />Метод Add добавляет в словарь новую пару ключ–элемент.</p>
<p style="-qt-paragraph-type:empty; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:15px; font-family:'Verdana,Arial,sans'; font-size:12px; font-weight:496; background-color:#fdfdfd;"><br /></p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="#dfefff" style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed514849298866"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#5499de;">1</span></p></td>
<td style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed514849298866-1"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">D</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">ictionary</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Add</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Ключ</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Элемент</span></p></td></tr></table>
<ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" background-color:#c8fbc8;" style=" margin-top:10px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Ключ</span> – обязательный аргумент, представляющий ключ добавляемой пары.</li>
<li style=" margin-top:10px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Элемент</span> – обязательный аргумент, представляющий элемент добавляемой пары.</li></ul>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Если добавляемый ключ в словаре уже есть, VBA Excel сгенерирует ошибку.</p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="aswift_1_host"></a><span style=" font-weight:600;">М</span><span style=" font-weight:600;">етод Exists</span><br />Метод Exists возвращает логическое значение, указывающее, существует ли в словаре указанный ключ. True – указанный ключ существует, False – указанный ключ не существует.</p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="#dfefff" style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;"></td>
<td style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed51a166746240-1"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">D</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">ictionary</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">Exists</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Ключ</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">)</span></p></td></tr></table>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Метод Items</span><br />Метод Items возвращает массив всех элементов в словаре.</p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="#dfefff" style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;"></td>
<td style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed51d914704778-1"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">D</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">ictionary</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">Items</span></p></td></tr></table>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Метод Keys</span><br />Метод Keys возвращает массив всех ключей в словаре.</p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="#dfefff" style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;"></td>
<td style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed520895680313-1"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">D</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">ictionary</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">Keys</span></p></td></tr></table>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Метод Remove</span><br />Метод Remove удаляет из словаря одну пару ключ–элемент.</p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="#dfefff" style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;"></td>
<td style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed523552364692-1"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">D</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">ictionary</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">Remove</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Ключ</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">)</span></p></td></tr></table>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Если указанный ключ не существует, произойдет ошибка.</p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Метод RemoveAll</span><br />Метод RemoveAll удаляет из словаря все пары ключей и элементов.</p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="#dfefff" style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;"></td>
<td style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed526754988475-1"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">D</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">ictionary</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">RemoveAll</span></p></td></tr></table>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="Svojstva_obekta_Dictionary"></a><span style=" font-size:large; font-weight:600;">С</span><span style=" font-size:large; font-weight:600;">войства объекта Dictionary</span></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Свойство CompareMode</span><br />Свойство CompareMode задает или возвращает режим сравнения ключей в словаре. Используется для чтения и записи.</p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="#dfefff" style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;"></td>
<td style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed52a184926607-1"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">D</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">ictionary</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">CompareMode</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">[</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Сравнение</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">]</span></p></td></tr></table>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Необязательный аргумент <span style=" font-weight:600;">Сравнение</span> используется только при записи и может принимать следующие значения:</p>
<ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" background-color:#c8fbc8;" style=" margin-top:10px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">–1</span> (vbUseCompareOption) – выполняется сравнение, заданное оператором Option Compare.</li>
<li style=" margin-top:10px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">0</span> (vbBinaryCompare) – выполняется двоичное сравнение.</li>
<li style=" margin-top:10px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">1</span> (vbTextCompare) – выполняется текстовое сравнение.</li></ul>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="aswift_2_host"></a>По умолчанию выполняется двоичное сравнение, при котором значение свойства CompareMode равно <span style=" font-weight:600;">0</span> (vbBinaryCompare).</p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="aswift_3_host"></a><span style=" font-weight:600;">С</span><span style=" font-weight:600;">войство Count</span><br />Свойство Count возвращает количество элементов в словаре. Только для чтения.</p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="#dfefff" style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;"></td>
<td style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed52f186009538-1"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">D</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">ictionary</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">Count</span></p></td></tr></table>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Свойство Item</span><br />Свойство Item задает или возвращает элемент для указанного ключа в словаре. Используется для чтения и записи.</p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="#dfefff" style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;"></td>
<td style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed538286989121-1"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">D</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">ictionary</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">Item</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Ключ</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">)</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">[</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">= </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Элемент</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">]</span></p></td></tr></table>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
<ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" background-color:#c8fbc8;" style=" margin-top:10px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Ключ</span> – обязательный аргумент, представляющий из себя существующий ключ для чтения или изменения существующего элемента, или новый ключ для создания новой пары ключ–элемент.</li>
<li style=" margin-top:10px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Элемент</span> – необязательный аргумент, представляющий выражение, которое заменяет существующий элемент с существующим ключом или добавляет новый элемент в пару ключ–элемент с новым ключом.</li></ul>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Если при создании с новым ключом новой пары ключ–элемент аргумент <span style=" font-weight:600;">Элемент</span> не указан, значение элемента будет пустым (Empty).</p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="aswift_4_host"></a><span style=" font-weight:600;">С</span><span style=" font-weight:600;">войство Key</span><br />Свойство Key задает новое значение ключа для существующего ключа в словаре.</p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="#dfefff" style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;"></td>
<td style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed53f798276567-1"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">D</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">ictionary</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">Key</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Ключ</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">)</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">НовыйКлюч</span></p></td></tr></table>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
<ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" background-color:#c8fbc8;" style=" margin-top:10px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Ключ</span> – обязательный аргумент, представляющий из себя существующий ключ.</li>
<li style=" margin-top:10px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">НовыйКлюч</span> – обязательный аргумент, представляющий выражение, значение которого заменяет существующий ключ.</li></ul>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Если указанный ключ отсутствует в словаре, произойдет ошибка.</p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="Primery_koda_s_Dictionary"></a><span style=" font-size:x-large; font-weight:600;">П</span><span style=" font-size:x-large; font-weight:600;">римеры кода с Dictionary</span></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Пример 1</span><br />Заполнение словаря парами ключ-элемент и извлечение элементов с помощью свойства Item:</p>
<p style="-qt-paragraph-type:empty; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:15px; font-family:'Verdana,Arial,sans'; font-size:12px; font-weight:496; background-color:#fdfdfd;"><br /></p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="#dfefff" style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;"></td>
<td style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed544875675388-1"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">S</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">ub</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">Primer1</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">()</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed544875675388-2"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">D</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">im</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">myDict </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">New</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Dictionary</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed544875675388-3"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">'</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">Добавляем три пары ключ-элемент</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed544875675388-4"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">m</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">yDict</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Add</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;№1&quot;</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;Ананас&quot;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed544875675388-5"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">m</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">yDict</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Add</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">2</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;Апельсин&quot;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed544875675388-6"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">m</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">yDict</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Add</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;Три&quot;</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;Мандарин&quot;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed544875675388-7"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">'</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">Смотрим количество записей в словаре</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed544875675388-8"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">M</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">sgBox </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">myDict</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Count</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed544875675388-9"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">'</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">Извлекаем элементы по ключам</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed544875675388-10"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">M</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">sgBox </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">myDict</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">Item</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;№1&quot;</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed544875675388-11"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">M</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">sgBox </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">myDict</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">Item</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">2</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed544875675388-12"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">M</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">sgBox </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">myDict</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">Item</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;Три&quot;</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed544875675388-13"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">E</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">nd</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Sub</span></p></td></tr></table>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="aswift_5_host"></a><span style=" font-weight:600;">П</span><span style=" font-weight:600;">ример 2</span><br />Замена элемента в существующей паре ключ-элемент, добавление новой пары ключ-элемент и добавление нового ключа без указания элемента с помощью свойства Item:</p>
<p style="-qt-paragraph-type:empty; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:15px; font-family:'Verdana,Arial,sans'; font-size:12px; font-weight:496; background-color:#fdfdfd;"><br /></p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="#dfefff" style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;"></td>
<td style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed549540559665-1"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">S</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">ub</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">Primer2</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">()</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed549540559665-2"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">D</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">im</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">myDict </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">New</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">Dictionary</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">_</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed549540559665-3"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">i</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Integer</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed549540559665-4"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">'</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">Добавляем три пары ключ-элемент</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed549540559665-5"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">m</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">yDict</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Add</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">1</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;Январь&quot;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed549540559665-6"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">m</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">yDict</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Add</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">2</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;Вторник&quot;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed549540559665-7"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">m</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">yDict</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Add</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">3</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;Среда&quot;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed549540559665-8"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">'</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">Меняем элемент в паре с ключом 1</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed549540559665-9"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">m</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">yDict</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">Item</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">1</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">)</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;Понедельник&quot;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed549540559665-10"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">'</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">Добавляем новую пару ключ-элемент</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed549540559665-11"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">m</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">yDict</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">Item</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">4</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">)</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;Четверг&quot;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed549540559665-12"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">'</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">Извлекаем элементы по ключам</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed549540559665-13"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">F</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">or</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">i</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">1</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">To</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">4</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed549540559665-14"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">MsgBox </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">myDict</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">Item</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">i</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed549540559665-15"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">N</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">ext</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed549540559665-16"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">'</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">Добавляем новый ключ без элемента,</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed549540559665-17"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">'</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">MsgBox покажет пустую строку</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed549540559665-18"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">M</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">sgBox </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">myDict</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">Item</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">5</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed549540559665-19"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">'</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">Убеждаемся, что теперь в словаре</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed549540559665-20"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">'</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">не 4, а 5 записей</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed549540559665-21"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">M</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">sgBox </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">myDict</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">Count</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed549540559665-22"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">E</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">nd</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Sub</span></p></td></tr></table>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Обратите внимание, добавить новый ключ без указания элемента можно только путем присвоения значения выражения переменной или, как во втором примере, <a href="https://vremya-ne-zhdet.ru/vba-excel/funktsiya-msgbox-parametry/"><span style=" text-decoration: underline; color:#0000ff;">функции MsgBox</span></a>:</p>
<p style="-qt-paragraph-type:empty; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:15px; font-family:'Verdana,Arial,sans'; font-size:12px; font-weight:496; background-color:#fdfdfd;"><br /></p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="#dfefff" style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;"></td>
<td style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed54f982804655-1"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">'</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">Так работает:</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed54f982804655-2"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">a</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">myDict</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">Item</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">НовыйКлюч</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed54f982804655-3"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">'</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">Так работает:</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed54f982804655-4"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">M</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">sgBox </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">myDict</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">Item</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">НовыйКлюч</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed54f982804655-5"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">'</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">Так не работает, вызывает ошибку:</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed54f982804655-6"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">m</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">yDict</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">Item</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">НовыйКлюч</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">)</span></p></td></tr></table>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Пример 3</span><br />Извлечение ключей и элементов в массив:</p>
<p style="-qt-paragraph-type:empty; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:15px; font-family:'Verdana,Arial,sans'; font-size:12px; font-weight:496; background-color:#fdfdfd;"><br /></p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="#dfefff" style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;"></td>
<td style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed552601416663-1"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">S</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">ub</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">Primer3</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">()</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed552601416663-2"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">D</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">im</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">myDict </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">New</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">Dictionary</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">_</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed552601416663-3"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">a</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Variant</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">b</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">String</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">_</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed552601416663-4"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">i</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Integer</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed552601416663-5"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">m</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">yDict</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Add</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;з&quot;</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;Зима&quot;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed552601416663-6"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">m</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">yDict</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Add</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;в&quot;</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;Весна&quot;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed552601416663-7"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">m</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">yDict</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Add</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;л&quot;</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;Лето&quot;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed552601416663-8"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">m</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">yDict</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Add</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;о&quot;</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;Осень&quot;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed552601416663-9"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">'</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">Извлекаем ключи в массив a</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed552601416663-10"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">a</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">myDict</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Keys</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed552601416663-11"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">'</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">Записываем извлеченные ключи</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed552601416663-12"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">'</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">в переменную b</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed552601416663-13"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">b</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;Ключи:&quot;</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> &amp; </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">vbNewLine</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed552601416663-14"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">For</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">i</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">1</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">To</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">myDict</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Count</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed552601416663-15"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">   </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">b</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">b</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> &amp; </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">vbNewLine</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> &amp; </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">a</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">i</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> - </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">1</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed552601416663-16"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Next</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed552601416663-17"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">'</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">Смотрим список ключей</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed552601416663-18"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">M</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">sgBox</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">b</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed552601416663-19"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">'</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">Извлекаем элементы в массив a</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed552601416663-20"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">a</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">myDict</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Items</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed552601416663-21"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">'</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">Записываем извлеченные</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed552601416663-22"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">'</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">элементы в переменную b</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed552601416663-23"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">b</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;Элементы:&quot;</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> &amp; </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">vbNewLine</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed552601416663-24"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">For</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">i</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">1</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">To</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">myDict</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Count</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed552601416663-25"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">   </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">b</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">b</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> &amp; </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">vbNewLine</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> &amp; </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">a</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">i</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> - </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">1</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed552601416663-26"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Next</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed552601416663-27"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">'</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">Смотрим список элементов</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ed552601416663-28"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">M</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">sgBox</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">b</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ed552601416663-29"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">E</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">nd</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Sub</span></p></td></tr></table>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#e6e6fa;"><a href="https://vremya-ne-zhdet.ru/vba-excel/soderzhaniye-rubriki/"><span style=" text-decoration: underline; color:#0000ff;">Содержание рубрики VBA Excel</span></a> по тематическим разделам со ссылками на все статьи.</p>
<p style=" margin-top:0px; margin-bottom:80px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#ffffff;"><a name="comments"></a><span style=" font-family:'Arial,Helvetica,sans-serif,Arial,Helvetica,sans-serif'; font-size:x-large; font-weight:600; color:#272626;">5</span><span style=" font-family:'Arial,Helvetica,sans-serif,Arial,Helvetica,sans-serif'; font-size:x-large; font-weight:600; color:#272626;"> комментариев для “VBA Excel. Объект Dictionary (свойства, методы, примеры)”</span></p>
<ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" font-family:'Arial,Helvetica,sans-serif,Arial,Helvetica,sans-serif'; font-size:16px; color:#272626;" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="comment-item-5505"></a><span style=" font-size:16px; font-weight:696;">Ф</span><span style=" font-size:16px; font-weight:696;">арин</span><a href="https://vremya-ne-zhdet.ru/vba-excel/object-dictionary/#comment-5505"><span style=" font-size:16px; text-decoration: underline; color:#0000ff;">17.11.2019 в 11:08</span></a></li>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:1; text-indent:0px;"><span style=" font-family:'Arial,Helvetica,sans-serif,Arial,Helvetica,sans-serif'; font-size:16px; color:#272626;">Отличная статья.<br />Евгений, а словари могут быть вложенными? например, значением может являться другая структура данных, например, другой словарь или коллекция?</span></p>
<ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 2;"><li style=" font-family:'Arial,Helvetica,sans-serif,Arial,Helvetica,sans-serif'; font-size:16px; color:#272626;" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="comment-item-5506"></a><span style=" font-size:16px; font-weight:696;">Е</span><span style=" font-size:16px; font-weight:696;">вгений</span><a href="https://vremya-ne-zhdet.ru/vba-excel/object-dictionary/#comment-5506"><span style=" font-size:16px; text-decoration: underline; color:#0000ff;">17.11.2019 в 13:49</span></a></li></ul>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:2; text-indent:0px;"><span style=" font-family:'Arial,Helvetica,sans-serif,Arial,Helvetica,sans-serif'; font-size:16px; color:#272626;">Привет, Фарин!<br />Словарь поддерживает любые типы данных. Причем не только в значениях, но и в ключах. Есть одно исключение: ключи не могут быть массивами. Пример с вложенным словарем:</span></p>
<p style="-qt-paragraph-type:empty; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:2; text-indent:0px; line-height:15px; font-family:'Verdana,Arial,sans'; font-size:12px; font-weight:496; color:#272626; background-color:#fdfdfd;"><br /></p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:80px; margin-right:0px;" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="#dfefff" style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;"></td>
<td style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ee17e233177730-1"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">S</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">ub</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">Primer</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">()</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ee17e233177730-2"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">D</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">im</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">myDict1</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">myDict2</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">a1</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">a2</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ee17e233177730-3"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Set</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">myDict1</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">CreateObject</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;Scripting.Dictionary&quot;</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ee17e233177730-4"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Set</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">myDict2</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">CreateObject</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;Scripting.Dictionary&quot;</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ee17e233177730-5"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">   </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">myDict1</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Add</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">1</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;Один&quot;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ee17e233177730-6"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">   </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">myDict1</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Add</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">2</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;Два&quot;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ee17e233177730-7"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">   </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">myDict1</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Add</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">3</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;Три&quot;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ee17e233177730-8"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">     </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">myDict2</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Add</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;Словарь&quot;</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">myDict1</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ee17e233177730-9"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Set</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">a1</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">myDict2</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">Item</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;Словарь&quot;</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ee17e233177730-10"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">a2</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">a1</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">Item</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">2</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-65049bd1ee17e233177730-11"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">M</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">sgBox </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">a2</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-65049bd1ee17e233177730-12"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">E</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">nd</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Sub</span></p></td></tr></table>
<li style=" font-family:'Arial,Helvetica,sans-serif,Arial,Helvetica,sans-serif'; font-size:16px; color:#272626;" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="comment-item-12213"></a><span style=" font-size:16px; font-weight:696;">W</span><span style=" font-size:16px; font-weight:696;">ulf 007</span><a href="https://vremya-ne-zhdet.ru/vba-excel/object-dictionary/#comment-12213"><span style=" font-size:16px; text-decoration: underline; color:#0000ff;">29.03.2023 в 10:08</span></a></li></ul>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:1; text-indent:0px;"><span style=" font-family:'Arial,Helvetica,sans-serif,Arial,Helvetica,sans-serif'; font-size:16px; color:#272626;">Заполнение и изменение словаря возможно без использования ключевого слова Item</span></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:1; text-indent:0px;"><span style=" font-family:'Arial,Helvetica,sans-serif,Arial,Helvetica,sans-serif'; font-size:16px; color:#272626;">Вместо<br /></span><span style=" font-family:'Courier New'; font-size:16px; color:#333333; background-color:#d0effb;">'Меняем элемент в паре с ключом 1<br />myDict.Item(1) = &quot;Понедельник&quot;<br />'Добавляем новую пару ключ-элемент<br />myDict.Item(4) = &quot;Четверг&quot;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:1; text-indent:0px;"><span style=" font-family:'Arial,Helvetica,sans-serif,Arial,Helvetica,sans-serif'; font-size:16px; color:#272626;">Можно и использовать<br /></span><span style=" font-family:'Courier New'; font-size:16px; color:#333333; background-color:#d0effb;">myDict(1) = &quot;Понедельник&quot;<br />'Добавляем новую пару ключ-элемент<br />myDict(4) = &quot;Четверг&quot;</span></p></body></html>